#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# ******************************************************************************/
"""
Description: General constants
Class:
"""
ROLE_DICT = {
    "version_manager": "版本经理",
    "security_committee": "安全委员会",
    "developer": "开发人员",
    "tester": "测试人员",
    "tc": "tc",
    "release": "release",
    "qa": "qa",
}
# ScanOSS API URL for jenkins trigger
JENKINS_API_URL = "https://shenzhen.scanoss.com/api/scan/direct"

# server repo for jenkins trigger
JENKINS_SERVER_REPO = "121.36.53.23"

# template job of aarch64
# AARCH64_TM_JOB = "function-item/release-manager/20210622172828/aarch64/2-2"
AARCH64_TM_JOB = "function-item/release-manager/openeuler-202106281604/aarch64/test-build"

# template job of x86
X86_TM_JOB = "function-item/release-manager/openeuler-202106281604/x86-64/test-build"

# template job of trigger
TRIGGER_TM_JOB = "function-item/release-manager/openeuler-202106281604/trigger0712"

# job for upload package rpm to server
OBS_RELEASE_JOB = "obs/guoxiaoqi_test"

# jenkins job path prefix
JENKINS_PATH_PREFIX = "function-item/release-manager/release_tools"
GITEE_REPO = "release-tools"

# log file path
LOG_DIR = "./"
ROLES = ["tc", "release", "qa", "security_committee", "version_manager"]
PERMISSION_DICT = {
    'cve': 'security',
    'bug': 'developer',
    'status': 'all',
    'requires': 'developer',
    'test': 'test',
    'release': 'all'
}

# gitee token
GITEE_TOKEN = ""

# get the ID with comment permission from the corresponding Gitee Issue
PERMISSION_INFO = {
    "version_manager": ["/start-update", "/no-release"],
    "security_committee": [
        "/add-cve",
        "/delete-cve",
        "/cve-ok",
        "/check-ok",
        "/cvrf-ok",
    ],
    "developer": [
        "/add-bugfix",
        "/delete-bugfix",
        "/bugfix-ok",
        "/check-status",
        "/get-requires",
    ],
    "tester": ["/test-ok"],
    "tc": ["/check-ok"],
    "release": ["/check-ok"],
    "qa": ["/check-ok"]
}

AK = ''
SK = ''
PAEAL_NUM = 5
REALSE_TOOLS_BUCKET_NAME = "release-tools"
REALSE_TOOLS_SERVER = "obs.cn-north-4.myhuaweicloud.com"
CVE_MANAGE_SERVER = "obs.ap-southeast-1.myhuaweicloud.com"
CVE_MANAGE_BUCKET_NAME = "openeuler-cve-cvrf"
CVE_UPDATE_INFO = "cve-manager-updateinfo"
user_email = ""
JENKINS_BASE_URL = 'https://jenkins.openeuler.org'
JENKINS_USER = 'tuShenmei'
JEKINS_PASS = '062725tu_TU'

JENKINS_INSTALL_JOB = "function-item/release-manager/openeuler-202106281604/test"
